function isProd () {
    return process.env.NODE_ENV === 'production'
}

const prodExternals = {
    "deepmerge": "deepmerge",
    "object-path": "object-path",
	  "three": "three",
    "vue": "vue",
    "vue-router": "vue-router",
    "vuex": "vuex"
}

const vueConfig = {
    pages: {
        index: 'src/main.js'
    },
    configureWebpack: {
        externals: isProd() ? prodExternals : {}
    },
    css: {
        sourceMap: isProd()
    },
    devServer: {
        open: true,
        index: process.env.VUE_APP_INDEX_BASE_URL,
        openPage: process.env.VUE_APP_OPEN_PAGE_URL,
        port: 80,
        hot: true
    },
    productionSourceMap: isProd(),
    lintOnSave: !isProd(),
    publicPath: isProd() ? '/lab/' : '/',
    assetsDir: isProd() ? './media/spaceship/' : './',
    filenameHashing: false
}

module.exports = vueConfig
